1. Field of the Invention
The present invention relates generally to terminal apparatuses such as printers, displays, and cash deposit devices used in automated teller machines (ATM), cash dispensers (CD), POS systems, and bank kiosks located in convenience stores, and relates more particularly to a transmission control device and transmission control method for sending data from such a terminal apparatus to a host system.
2. Description of the Related Art
ATMs, cash dispensers, POS terminals, bank kiosks, and other such systems typically have a main control device such as a personal computer (referred to below as a PC or host system) and multiple terminal devices, such as printers, display devices, cash dispensers, storage devices, and bar code readers, connected to and controlled by the host system. The host systematically controls the overall operation of the various internal terminal devices in order to achieve the desired functionality of the ATM, POS system, or other system. More specifically, the host and terminal devices are connected by a data communication line, enabling the host to send control commands and other data to the terminal devices and thereby control terminal device operation. The terminal devices send data to the host according to the terminal device function, and, when requested by the host, send a status report indicating the operating status of the terminal device to the host. Most of the terminal devices installed in the system connect to the host through a serial port (such as RS-232C) used to exchange process data and commands between the host and terminal devices.
An interface device is located between the various system components, and a control line is provided for controlling communications. A terminal device, for example, can use a data terminal ready (DTR) signal to notify the host of whether or not it is ready to receive data. When the DTR signal goes active (active state), the host sets the data set ready (DSR) signal active, and sends data after confirming that both sides are in an operating state. This makes it possible to prevent data from being dropped during data communication.
The present invention is applicable to all terminals, but to simplify the following description, it is exemplarily described as applied to a printer, which is a terminal device that is frequently used in ATMs, POS systems, and the like.
A printer typically cannot print if there is an internal shortage of any necessary printing supplies, such as printing paper or ink. It has therefore been made possible for the host to be able to confirm how much printing paper and ink remains available to the printer. More specifically, the printer is configured to send ink-near-end or paper-near-end status data to the host if the remaining printing paper or ink supply becomes low, and to send ink-end or paper-end status data if the supply is completely depleted. Various other status data may be sent to the host in addition to the above examples, including printer-cover-open, ink-tank-removed, paper-jam, and power-supply status data.
The printer may become unable to operate as a terminal (a state referred to below as being off-line) if, for example, its receive buffer becomes full (a receive-buffer-full status), a paper jams, or other error occurs such as the printer cover being open. If the printer, that is, the terminal device, goes off-line, it is necessary to notify the host of the terminal's off-line status and interrupt, i.e. stop, the sending of data from the host to the off-line terminal.
Data is sent to the host in response to a status request command from the host, and there are different types of status request commands. To confirm a terminal device's status, for example, the host may send a command to an individual terminal device to have the status information sent from that terminal device. Additionally, the terminal device may use a function for sending status data automatically to the host whenever there is a change in a particular status (referred to below as an Automatic Status Back (ASB) function).
A data transmission control apparatus according to the prior art is described in further detail below with reference to FIG. 8. FIG. 8 is a function block diagram showing only the major parts of a printer 70 according to the prior art. The host 90 controls the overall POS system. Though not shown in FIG. 8, numerous terminal devices such as a display device and cash drawer (not shown in the figure) required to achieve the functions of a POS system are connected to the host 90 in addition to printer 70, and the host controls these terminal devices by exchanging data with the terminal devices.
The printer 70 is controlled by sending control commands and data from the host 90 to the printer 70. A personal computer with a general purpose operating system can be used in the host 90. In order to control the printer 70, the host 90 can send a command telling the printer 70 to report its condition (status). In response to the command from the host 90, the printer 70 then sends the requested status.
The host 90 and printer 70 are connected through a serial communications port (RS-232C) driver, for example. Printer control commands and other data sent from the host 90 are received through the receive driver 71 by the receive unit 72. Received data is saved (stored) to a receive buffer (not shown in the figure) in the receive unit 72. Data saved to the receive buffer is interpreted by the command interpreter 73 in the order it was saved to the receive buffer.
The command interpreter 73 interprets and executes the commands. For example, if a print command is received the command interpreter 73 prepares the print data in a print buffer (not shown in the figure), and the data is then printed by head driver 76 and print mechanism 77 under the control of the print controller 74. A motor driver 75 handles transporting the print paper (not shown in the figure) and moving the head carriage (not shown in the figure).
A status monitor 80 is connected to a power supply voltage detector 81, paper detector 82, ink detector 83, cover detector 84, switch detector 85 for detecting paper jams, and other detectors 86, and monitors the internal condition of the printer 70. An abnormal supply voltage, the presence and amount of remaining printing paper, the presence and amount of remaining ink, whether the covers are open or closed, the occurrence of any paper jams, carriage drive errors, the receive buffer being full, and other printer conditions are detected by detectors 81 to 86 and passed to the status monitor 80.
The print status, receive buffer full status, and other status reports are also passed to the status monitor 80 by the print controller 74 and receive unit 72, for example.
When a status request command is sent from the host 90, it is passed through the receive unit 72 and interpreted by the command interpreter 73, and status information is then sent from status monitor 80 through the data transmission driver 78 to the host 90.
The status of the printer 70 is sent to the host 90 even when the ASB function is used. By first enabling the ASB function, the host 90 can be automatically informed of certain printer conditions (status), including errors, cover open status, paper position, and remaining ink quantity.
The status data may be only one byte long or may be several bytes. If it is one byte, that is, 8 bits, eight types of status data can be communicated, and as the byte count increases so does the amount of status data. A case in which ASB status data that is four bytes long is sent to the host 90 is described next.
If the ASB function is enabled and there is a change in a specified status, the status monitor 80 assembles a particular status report of four bytes and sends it through data transmission driver 78 to the host 90. Note that when starting a transmission, the terminal first checks whether the host 90 can receive data, and starts transmission if the host is not in a state in which it is unable to receive data (referred to below as a busy state).
Status data such as described above is sent sequentially to the host as communication data. Furthermore, because ASB and other status data is sent automatically to the host whenever there is a change in status, status data may be sent one after another. The problem is that this could cause the transmission buffer of the terminal device to become full (resulting in a buffer-full state), making it unable to store further information and possibly result in the loss of status data generated after the buffer becomes full.